home *** CD-ROM | disk | FTP | other *** search
- on mouseDown
- global beginG, draaien_v2
- beginX = the mouseH - sprite(19).locH
- beginY = the mouseV - sprite(19).locV
- if beginX = 0 then
- beginX = 0.10000000000000001
- end if
- beginG = atan(float(beginY) / float(beginX)) / (PI / 180)
- draaien_v2 = 1
- end
-
- on mouseUp
- global draaien_v2
- draaien_v2 = 0
- end
-
- on mouseUpOutSide
- global draaien_v2
- draaien_v2 = 0
- end
-
- on enterFrame
- global draaien_v2, beginG, VorigG, NuG, horizontaal
- if draaien_v2 = 1 then
- VorigG = NuG
- NuX = the mouseH - sprite(19).locH
- NuY = the mouseV - sprite(19).locV
- if NuX = 0 then
- NuX = 0.10000000000000001
- end if
- NuG = atan(float(NuY) / float(NuX)) / (PI / 180)
- ResultaatG = NuG - beginG
- sprite(19).rotation = ResultaatG
- verdraaiingG = NuG - VorigG
- if verdraaiingG < -300 then
- verdraaiingG = verdraaiingG + 360
- end if
- horizontaal = horizontaal + verdraaiingG
- repeat while horizontaal > 260
- if horizontaal > 260 then
- horizontaal = horizontaal - 180
- end if
- end repeat
- repeat while horizontaal < 80
- if horizontaal < 80 then
- horizontaal = horizontaal + 180
- end if
- end repeat
- end if
- end
-
- on mouseEnter
- cursor(280)
- end
-
- on mouseLeave
- cursor(-1)
- end
-